import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    // 全局个人数据
    loginObj:{},
    isLogin:true,
    avatar: '',
    loading:false,
    //疫情数据
    yqObj:{},
    //新闻分类列表
    classifyList:[],
    slideshowList:[],
    tabActive:0,
    slideshowFlag:false,
  },
  mutations: {
    //获取登录信息
    getloginObj(state,payload) {
      state.loginObj = payload
    },
    //获取登录状态
    getLogin(state,payload) {
      state.isLogin = payload
    },
    //获取轮播图列表
    changeSlideshowList(state,payload) {
      state.slideshowList = payload
    },
    changeSlideshowFlag(state,payload) {
      state.slideshowFlag = payload
    },
    changeTabActive(state,payload) {
      state.tabActive = payload
    },
    changeClassifyList(state,payload) {
      state.classifyList = payload
    },
    getloading(state,payload) {
      state.loading = payload
    },
    getyqObj(state,payload) {
      state.yqObj = payload
    }
  },
  actions: {
  },
  modules: {
  }
})
